﻿@using IdentityServer.Infrastructure.Identity
@inject UserManager UserManager
@inject SignInManager SignInManager

<div class="container-fluid fs-5 lh-lg">
	@if (SignInManager.IsSignedIn(User))
	{
		<h1>Welcome @UserManager.GetUserName(User)</h1>
		<div>UserClaims</div>
		@foreach (var claim in Context.User.Claims)
		{
			<div>
				<code>@claim.Type</code>: <strong>@claim.Value</strong>
			</div>
		}
		<a class="btn  btn-info" asp-controller="Manage" asp-action="AccountManage">设置</a>
		<a class="btn  btn-danger" asp-controller="Authorization" asp-action="Logout">登出</a>
	}
	else
	{
		<!-- 首页未登录 -->
		<h1>Welcome, Anonymous</h1>
		<p>您当前未登录</p>
		<a class="btn btn-primary" asp-controller="Account" asp-action="Login">登录</a>
		<span>&nbsp;</span>
		<a class="btn btn-info" asp-controller="Account" asp-action="Register">注册</a>
	}
</div>

